package com.dmp.frame.springboot.demo.Controller;

import com.dmp.frame.core.exception.ServiceException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xufeng
 * @description: 测试一下包装类 和全局异常
 * @date 2022-04-20 13:47
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @PostMapping("/hello")
    public String test(){
        return "hello";
    }

    @GetMapping("/serviceEx")
    public void serviceEx(){
        throw new ServiceException(200,"zzz");
    }
}
